
clus=$1
celltype_name=$2
genome_type=$3
cpu=$4
config_path=$5

source ${config_path}/config.sh

data_base_list=(jaspar cisbp)

for data_base in ${data_base_list[@]}
do
${Rscript_chromvar} ${scripts_dir}/run_chromvar.R \
--peakfile ${output_dir}/motif/${clus}_peak.bed \
--bamfiles ${input_dir}/${clus}_merge_sorted.reviewRG.bam \
--cell_qc_file ${output_dir}/cluster_all_result/cell_fragment/testis_merge_all_qc_barcode_new.txt \
--celltype_name ${celltype_name} \
--data_base ${data_base} \
--genome_type ${genome_type} \
--cpu ${cpu} \
--out_path ${output_dir}/motif/${clus}/${data_base} \
--cluster ${clus} \
2> ${log_path}/run_chromvar.${clus}.${data_base}.log
done
